package com.rd.student.jiaji.class2.duyukun.Day0731;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        List<Integer> numbers = new ArrayList<>();


        for (int i = 0; i < 50; i++) {
            numbers.add(i);
        }

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入要随机的次数：");
        int n = scanner.nextInt();

        Collections.shuffle(numbers);

        for (int i = 0; i < n; i++) {
            System.out.print(numbers.get(i) + " ");

        }
    }

}
